<?php

/*
=====================================================
 FluxBB - Delux Board Converstations (DBC)
-----------------------------------------------------
 http://dbc-forum.com/
 http://fluxbb.org/
-----------------------------------------------------
 Copyright (c) 2010,2011 FluxBB - Delux Board Conversations (DBC)
-----------------------------------------------------
 Предсловие: Данный скрипт (DBC) не является работой с нуля, то 
 есть ядром скрипта всё также остаётся FuxBB,но теперь в оболочке
 DBC.
=====================================================
*/
 
define('DBC_STATIC', 1);
define('DBC_ROOT', './');
require DBC_ROOT.'engine/common.php';

//query info out of the DB
$result = $db->query("SELECT id, title, content FROM ".$db_prefix."pages WHERE id='".intval($_GET['id'])."'") or error('Unable to fetch page information', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
	message($lang_common['Bad request']);
	
$data = $db->fetch_assoc($result);

//Set the page title here
$page_title = array(DBC_htmlspecialchars($DBC_config['o_board_title']),DBC_htmlspecialchars($data['title']));
define('DBC_ALLOW_INDEX', 1);
require DBC_ROOT.'engine/engine.php';

//replace custom bbcode
$pattern = array('#\n\[page_title=([^\[]*?)\]#s',
				 '#\n\[page_break\]#s');
$replace = array("\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n".'<div class="block">'."\n\t".'<h2><span>$1</span></h2>'."\n\t".'<div class="box">'."\n\t\t".'<div class="inbox">',
				 "\n\t\t".'</div>'."\n\t".'</div>'."\n".'</div>'."\n".'<div class="block">'."\n\t".'<div class="box">'."\n\t\t".'<div class="inbox">');
				 
$content = preg_replace($pattern, $replace, $data['content']);
?>
<div class="block">
<table width="100%" height="38" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="28" class="bg_forum_title_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_title_center"><span class="cat_title"><?php echo $data['title'] ?></span></td>
<td align="center" width="28" class="bg_forum_title_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></table>

<table class="forum_adv_table"  width="100%" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" class="forum_adv_tleft" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" width="100%"><div class="forum_adv_c">

	<div class="box">
		<div class="inbox satic_block">
<?php echo $content."\n" ?>
		</div>
	</div>
</div></td>
<td align="left" class="forum_adv_tright" width="2"><img src="engine/skins/images/spacer.gif" border="0"></td>
</td></tr></table>
<table width="100%" height="23" border="0" cellpadding="0" cellspacing="0"><thead><tr>
<td align="left" width="30" class="bg_forum_bott_left"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="left" class="bg_forum_bott_center"><img src="engine/skins/images/spacer.gif" border="0"></td>
<td align="center" width="30" class="bg_forum_bott_right"><img src="engine/skins/images/spacer.gif" border="0"></td>
</tr></thead></table>
</div>
<?php
$footer_style = 'index';
require DBC_ROOT.'engine/footer.php';